home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / criterrc.zip / CRITERR.H < prev    next >
C/C++ Source or Header  |  1991-02-17  |  8KB  |  249 lines

  1. /* HEADER FILE CRITERR.H
  2.  *
  3.  * FOR USE WITH ALERNATE CRITICAL ERROR HANDLER
  4.  *
  5.  * BY PETER HYMAN
  6.  *
  7.  * modified 2/16/91 to change structure CE and make small descriptive
  8.  * changes to the arrays
  9.  */
  10.  
  11. #ifndef __CERR_H
  12. #define __CERR_H
  13. extern struct CE
  14. {
  15.     unsigned char ceflag;                          /* critical error flag 1=yes */
  16.     unsigned char cerrno;                          /* critical error number */
  17.     int cerrtype;                                  /* critical error type, returned by AX */
  18.     unsigned char    drive;                                     /* drive letter of error */
  19.     unsigned char    read_wr;                         /* read or write error */
  20.     unsigned char    disk_area;                       /* where on disk, 0 = DOS, 1 = FAT, 2 = DIR, 3 = DATA */
  21.     unsigned char    resp_mask;                       /* really a pad, but shows allowable responses ( see tech ref ) */
  22.     unsigned char    exterr;                          /* extended error number  DOS >= 3 */
  23.   unsigned char eclass;                             /* error class */
  24.   unsigned char action;                             /* action recommendations */
  25.   unsigned char locus ;                          /* location of error */
  26.   long nextdev;                                     /* long pointer to next device */
  27.   short attr;                                       /* device attributes */
  28.   short sfunc;                                     /* short pointer to strategy function */
  29.   short ifunc;                                     /* short pointer to interrupt function */
  30.   char name[8];                                  /* device name */
  31.     char dummy;                                                                         /* terminating null */
  32. } cerr;                                          /* critical error struct */
  33.  
  34. /* function prototypes for setting of critical error trap */
  35.  
  36. extern int criterr( int );
  37. extern void clrcriterr( void );
  38.  
  39. /* THE FOLLOWING ARRAYS OF ERRORS ARE COMPLETE LISTINGS OF ALL
  40.  * ERRORS REPORTED BY DOS.  THEY CORRESPOND TO THE EXTENDED ERROR
  41.  * NUMBERS ( AND IN THE CASE OF OS_ERRLIST, TO ERRNO, UP TO #18 )
  42.  * THESE ARRAYS MAY BE OMITTED FROM FILES IF THEY ARE NOT NEEDED
  43.  */
  44.  
  45. /* Critical Error Messages: use cerr.cerrno as index */
  46.  
  47. char *crit_errlist[] =
  48. {
  49. /* 00h */     "Write Protect Error",
  50. /* 01h */     "Invalid Drive Specified",
  51. /* 02h */     "Drive Not Ready",
  52. /* 03h */     "Invalid Command",
  53. /* 04h */     "CRC Error",
  54. /* 05h */     "Bad Request Structure Length",
  55. /* 06h */     "Seek Error",
  56. /* 07h */     "Unknown Medium",
  57. /* 08h */     "Sector Not Found",
  58. /* 09h */     "Printer Out Of Paper",
  59. /* 0ah */     "Write Error",
  60. /* 0bh */     "Read Error",
  61. /* 0ch */     "General Failure"
  62. };
  63.  
  64. int num_criterr = sizeof( crit_errlist ) / sizeof( crit_errlist[0] );
  65.  
  66. /* Read/Write Errors: use cerr.read_wr as index */
  67.  
  68. char *readwr_list[] =
  69. {
  70. /* 00 */    "Reading",
  71. /* 01 */    "Writing"
  72. };
  73.  
  74. /* DISK Area Errors: use cerr.disk_area as index */
  75.  
  76. char *diskarea_list[] =
  77. {
  78. /* 00 */    "DOS/System Area",
  79. /* 01 */    "FAT Area",
  80. /* 02 */    "Directory Area",
  81. /* 03 */    "Data Area"
  82. };
  83.  
  84. char *respmask_list[] =
  85. {
  86. /* 00 */    "Abort Suggested",
  87. /* 01 */    "Abort or Fail Allowed",
  88. /* 02 */    "Abort or Retry Allowed",
  89. /* 03 */    "Abort, Retry or Fail Allowed",
  90. /* 04 */    "Abort or Ignore Allowed",
  91. /* 05 */    "Abort, Fail or Ignore Allowed",
  92. /* 06 */    "Abort, Retry or Ignore Allowed",
  93. /* 07 */    "Abort, Fail, Retry or Ignore Allowed"
  94. };
  95.  
  96. /* Operating System Errors: use cerr.exterr as index */
  97. /* or from errno if not critical error */
  98.  
  99. char *os_errlist[] =
  100. {
  101. /* 00 */        "Unknown Error Code",
  102. /* 01 */        "Invalid Function Number",
  103. /* 02 */        "File Not Found",
  104. /* 03 */        "Path Not Found",
  105. /* 04 */        "Too Many Files Opened",
  106. /* 05 */        "Access Denied",
  107. /* 06 */        "Invalid Handle",
  108. /* 07 */        "Memory Control Blocks Destroyed",
  109. /* 08 */        "Insufficient Memory",
  110. /* 09 */        "Invalid Memory Block Address",
  111. /* 10 */        "Invalid Environment",
  112. /* 11 */        "Invalid Format",
  113. /* 12 */        "Invalid Access Code",
  114. /* 13 */        "Invalid Data",
  115. /* 14 */        "Error 14",
  116. /* 15 */        "Invalid Drive Code",
  117. /* 16 */        "Can't Remove Current Directory",
  118. /* 17 */        "Not Same Device",
  119. /* 18 */        "No More Files",
  120. /* 19 */        "Can't Write on Protected Device",
  121. /* 20 */        "Unknown Unit",
  122. /* 21 */        "Drive Not Ready",
  123. /* 22 */        "Unknown Command",
  124. /* 23 */        "Data Error (CRC)",
  125. /* 24 */        "Bad Request Structure Length",
  126. /* 25 */        "Seek Error",
  127. /* 26 */        "Unknown Media Type",
  128. /* 27 */        "Sector Not Found",
  129. /* 28 */        "Printer Out Of Paper",
  130. /* 29 */        "Write Fault",
  131. /* 30 */        "Read Fault",
  132. /* 31 */        "General Failure",
  133. /* 32 */        "Sharing Violation",
  134. /* 33 */        "Lock Violation",
  135. /* 34 */        "Invalid Disk Change",
  136. /* 35 */        "FCB Unavailable",
  137. /* 36 */        "Sharing Buffer Overflow",
  138. /* 37 */        "Error 37",
  139. /* 38 */        "Error 38",
  140. /* 39 */        "Error 39",
  141. /* 40 */        "Error 40",
  142. /* 41 */        "Error 41",
  143. /* 42 */        "Error 42",
  144. /* 43 */        "Error 43",
  145. /* 44 */        "Error 44",
  146. /* 45 */        "Error 45",
  147. /* 46 */        "Error 46",
  148. /* 47 */        "Error 47",
  149. /* 48 */        "Error 48",
  150. /* 49 */        "Error 49",
  151. /* 50 */        "Network Request Not Supported",
  152. /* 51 */        "Remote Computer Not Listening",
  153. /* 52 */        "Duplicate Name on Network",
  154. /* 53 */        "Network Name Not Found",
  155. /* 54 */        "Network Busy",
  156. /* 55 */        "Network Device No Longer Exists",
  157. /* 56 */        "Net BIOS Command Limit Exceeded",
  158. /* 57 */        "Network Adaptor Hardware Error",
  159. /* 58 */        "Incorrect Response from Network",
  160. /* 59 */        "Unexpected Network Error",
  161. /* 60 */        "Incompatible Remote Adaptor",
  162. /* 61 */        "Print Queue Full",
  163. /* 62 */        "Not Enough Space for Print File",
  164. /* 63 */        "Print File was Deleted",
  165. /* 64 */        "Network Name was Deleted",
  166. /* 65 */        "Access Denied",
  167. /* 66 */        "Incorrect Network Device Type",
  168. /* 67 */        "Network Name not Found",
  169. /* 68 */        "Network Name Limit Exceeded",
  170. /* 69 */        "Net BIOS Session Limit Exceeded",
  171. /* 70 */        "Temporarily Paused",
  172. /* 71 */        "Network Request not Accepted",
  173. /* 72 */        "Print or Disk Redirection is Paused",
  174. /* 73 */        "Error 73",
  175. /* 74 */        "Error 74",
  176. /* 75 */        "Error 75",
  177. /* 76 */        "Error 76",
  178. /* 77 */        "Error 77",
  179. /* 78 */        "Error 78",
  180. /* 79 */        "Error 79",
  181. /* 80 */        "File Exists",
  182. /* 81 */        "Error 81",
  183. /* 82 */        "Cannot Make Directory Entry",
  184. /* 83 */        "Fail on INT 24",
  185. /* 84 */        "Too Many Redirections",
  186. /* 85 */        "Duplicate Redirection",
  187. /* 86 */        "Invalid Password",
  188. /* 87 */        "Invalid Parameter",
  189. /* 88 */        "Network Device Fault"
  190. };
  191.  
  192. int num_oserr = sizeof( os_errlist ) / sizeof( os_errlist[0] );
  193.  
  194. /* Error Classes: use cerr.eclass as index */
  195.  
  196. char *err_classlist[] =
  197. {
  198. /* 00h */    "Unknown",
  199. /* 01h */    "Out of Resource",
  200. /* 02h */ "Temporary Situation",
  201. /* 03h */    "Authorization",
  202. /* 04h */    "Internal Error",
  203. /* 05h */    "Hardware Failure",
  204. /* 06h */    "System Failure",
  205. /* 07h */    "Application Program Error",
  206. /* 08h */    "Not Found",
  207. /* 09h */    "Bad Format",
  208. /* 0ah */    "Locked Item",
  209. /* 0bh */    "Media Failure",
  210. /* 0ch */    "Already Exists",
  211. /* 0dh */    "Unknown"
  212. };
  213.  
  214. int num_errclass = sizeof( err_classlist ) / sizeof( err_classlist[0] );
  215.  
  216. /* Error Actions: use cerr.action as index */
  217.  
  218. char *err_actionlist[] =
  219. {
  220. /* 00 */ "Unknown",
  221. /* 01 */ "Retry",
  222. /* 02 */ "Delay Retry",
  223. /* 03 */ "User Input",
  224. /* 04 */ "Abort",
  225. /* 05 */ "Immediate Exit",
  226. /* 06 */ "Ignore",
  227. /* 07 */ "Retry after User Intervention"
  228. };
  229.  
  230. int num_erraction = sizeof( err_actionlist ) / sizeof( err_actionlist[0] );
  231.  
  232. /* Error Loci: use cerr.locus as index */
  233.  
  234. char *err_locuslist[] =
  235. {
  236. /* 00 */ "Unknown",
  237. /* 01 */ "Unknown",
  238. /* 02 */ "Block Device",
  239. /* 03 */ "Network",
  240. /* 04 */ "Serial Device",
  241. /* 05 */ "Memory"
  242. };
  243.  
  244. int num_errlocus = sizeof( err_locuslist ) / sizeof( err_locuslist[0] );
  245.  
  246. #endif
  247.  
  248. /* end of header */
  249.